<?php
abstract class Page{
	public $title="";
	public $data=array();
	public function __construct($title=""){
		$this->title=$title;
	}
	public function set($key,$val){
		$this->data[$key]=$val;
	}
	public function Display(){
		echo "<html>\n";
		echo "<head>\n";
		echo "<meta charset='utf-8'/>\n";
		echo "<link rel='stylesheet' type='text/css' href='css/style.css' />\n";
		echo "<title>".$this->title."</title>\n";
		echo "</head>\n";
		echo "<body>\n";
		$this->DisplayHeader();
		$this->DisplayContent();
		$this->DisplayFooter();
		echo "</body>\n";
		echo "</html>\n";
	}
	public function DisplayHeader(){
		echo "<header>\n";
		echo "<h1>".$this->title."</h1>\n";
		echo "</header>\n";
	}
	public function DisplayFooter(){
		date_default_timezone_set("Asia/Shanghai");
		echo "<footer>\n";
		echo "<p>".date("Y-m-d h:i:s a",time())."</p>\n";
		echo "</footer>\n";
	}
	public abstract function DisplayContent();
}